from django.db import models

# Create your models here.

class User(models.Model):
    username=models.CharField(verbose_name='用户账号',unique=True,max_length=64)
    password =models.CharField(verbose_name='用户密码',max_length=64)


class Item(models.Model):

    choicesitem=[("available","available"),("sold","sold")]

    title =models.CharField(max_length=255,verbose_name='物品名称')
    price =models.DecimalField(verbose_name='物品价格',max_digits=10,decimal_places=2)
    seller_id=models.ForeignKey(User,on_delete=models.CASCADE,related_name='item')
    status =models.CharField(max_length=16,choices=choicesitem,default="available")

